package com.ican.quartz;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ican.nc.NcAutoService;

public class DataNcJob {
    private final static Logger logger = LoggerFactory.getLogger(DataNcJob.class);
    private NcAutoService ncAutoService;
    
    public void scanAuto(){
        try{
            ncAutoService.scanAuto();
        }catch(Exception e){
            logger.error(e.getMessage(), e);
        }
        try{
            ncAutoService.updateWebsiteScanNum();
        }catch(Exception e){
            logger.error(e.getMessage(), e);
        }
        try{
            ncAutoService.updateCategoryNcNum();
        }catch(Exception e){
            logger.error(e.getMessage(), e);
        }
    }
    
    public void ncAuto(){
        try{
            ncAutoService.ncAuto();
        }catch(Exception e){
            logger.error(e.getMessage(), e);
        }
    }
    
    @Resource
    public void setNcAutoService(NcAutoService ncAutoService) {
        this.ncAutoService = ncAutoService;
    }
}
